package com.weixin.paleituo.view;

import android.content.Context;
import android.view.Gravity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.weixin.paleituo.R;
import com.weixin.paleituo.util.UIUtils;

/**
 * Author yichao
 * Time  2018/4/6 15:20
 * Dest  购物车弹窗
 */
public class ShopCarToastView extends Toast {

    private final ImageView mImageView;
    private final TextView mTextView;

    public ShopCarToastView(Context context) {
        super(context);

        View inflate = UIUtils.inflate(context, R.layout.layout_addshop_cart);
        mImageView = inflate.findViewById(R.id.iv_layout_addshop_cart);
        mTextView = inflate.findViewById(R.id.tv_layout_addshop_cart);
        setView(inflate);
        setGravity(Gravity.FILL_VERTICAL|Gravity.FILL_HORIZONTAL, 0,0);
    }

    public void setIcon(int resourse){
        mImageView.setImageResource(resourse);

    }
    public void setText(String content){
        mTextView.setText(content);
    }


}
